<div class="users index">
    <h2 class="left"><?php echo $html->image('iconos/users.png'); __('Usuarios'); ?></h2>
    <div class="actions specific right">
        <ul>
            <li><?php echo $this->Html->link(__('Nuevo Usuario', true), array('action' => 'add')); ?></li>
        </ul>
    </div>
    <table cellpadding="0" cellspacing="0">
        <tr>
<!--            <th><?php echo $this->Paginator->sort('Id', 'id'); ?></th>-->
            <th><?php echo $this->Paginator->sort('Apellido', 'last_name'); ?></th>
            <th><?php echo $this->Paginator->sort('Nombre', 'first_name'); ?></th>
            <th><?php echo $this->Paginator->sort('Nombre de Usuario', 'username'); ?></th>
<!--			<th><?php echo $this->Paginator->sort('Contraseña', 'password'); ?></th>-->
            <th><?php echo $this->Paginator->sort('Nivel', 'level'); ?></th>
            <th><?php echo $this->Paginator->sort('Estado', 'status'); ?></th>
<!--			<th><?php echo $this->Paginator->sort('Creado', 'created'); ?></th>
            <th><?php echo $this->Paginator->sort('Ultima entrada', 'last_login'); ?></th>-->
            <th class="actions"><?php __('Opciones'); ?></th>
        </tr>
        <?php
        $aux = array('Admin', 'Cerrajeria', 'Codificadas');
        $i = 0;
        foreach ($users as $user):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
            <tr<?php echo $class; ?>>
<!--                <td><?php echo $user['User']['id']; ?>&nbsp;</td>-->
                <td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
                <td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
                <td><?php echo $user['User']['username']; ?>&nbsp;</td>
    <!--		<td><?php echo $user['User']['password']; ?>&nbsp;</td>-->
                <td><?php echo $aux[$user['User']['level'] - 1]; ?>&nbsp;</td>
                <td><?php echo $user['User']['status']; ?>&nbsp;</td>
    <!--		<td><?php
            $creado = date('d/m/Y', strtotime($user['User']['created']));
            echo $creado;
            ?>&nbsp;</td>
                <td><?php
            $ultimo_log = date('d/m/Y H:i:s', strtotime($user['User']['last_login']));
            echo $ultimo_log;
            ?>&nbsp;</td>-->
                <td class="actions">
                    <?php echo $this->Html->link(__('Ver', true), array('action' => 'view', $user['User']['id'])); ?>
    <?php echo $this->Html->link(__('Editar', true), array('action' => 'edit', $user['User']['id'])); ?>
            <?php echo $this->Html->link(__('Contraseña', true), array('action' => 'contrasenia', $user['User']['id'])); ?>
            <?php echo $this->Html->link(__('Eliminar', true), array('action' => 'delete', $user['User']['id']), null, sprintf(__('Esta seguro que desea eliminar al usuario # %s?', true), $user['User']['username'])); ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
    <p>
        <?php
        echo $this->Paginator->counter(array(
            'format' => __('Página %page% de %pages%, mostrando %current% registros de %count% en total, a partir del registro %start%, terminando en el %end%', true)
        ));
        ?>	</p>

    <div class="paging">
        <?php echo $this->Paginator->prev('<< ' . __('anterior', true), array(), null, array('class' => 'disabled')); ?>
        | 	<?php echo $this->Paginator->numbers(); ?>
        |
<?php echo $this->Paginator->next(__('siguiente', true) . ' >>', array(), null, array('class' => 'disabled')); ?>
    </div>
</div>